<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/vue.js"></script>
    <style>
    </style>
</head>
<body>
    <div id="app">
        <button @click="isShow = !isShow">
                显示/隐藏</button>
        <com1>
            <com2 slot="s1" v-show="isShow"></com2>
        </com1>
    </div>
    <script>
    Vue.component("com1",{
        template:`
            <div>
                <slot name="s1"></slot></div>
        `,
    })
    Vue.component("com2",{
        template:`
            <div>
                <ul>
                    <li>11</li>
                    <li>11</li>
                    <li>11</li>
                    <li>11</li>
                    <li>11</li>
                </ul>
            </div>
        `,
    })
        const app = new Vue({
            el:"#app",
            data: {
                isShow:false
            }

        });

    </script>
</body>
</html>